This is an R Markdown Notebook. When you execute code within the notebook, the results appear beneath the code.
Try executing this chunk by clicking the Run button within the chunk or by placing your cursor inside it and pressing Cmd+Shift+Enter.
####Interaactive Map
tmap_mode('view')
tmap mode set to interactive viewing
tm_shape(af_2) +
tm_fill("white",popup.vars=c("County"="cnty_nm","Tract"="NAMELSA","R/ECAPS Status"="rcp_crr","Poverty Rate (%)"="pct_por","Moran I"="lI","G-Stat"="lG", "Affordable Units"="hh_ffr_", "p-value"="pvalue")) +
tm_borders("grey", lwd = 0.5)+tm_shape(af_2.sub)+tm_polygons("lI", title = "Clustering", palette = "PRGn",
style = "kmeans",
legend.hist = T,popup.vars=c("County"="cnty_nm","Tract"="NAMELSA","R/ECAPS Status"="rcp_crr","Poverty Rate (%)"="pct_por","Moran I"="lI","G-Stat"="lG", "Affordable Units"="hh_ffr_", "p-value"="pvalue")) +
tm_layout(frame = F, title = "Moran's I p-values<=.05",
legend.hist.size = 0.5,
legend.outside = T)